<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2023/4/30
  Time: 23:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="/css/style.css" rel="stylesheet" type="text/css" />
<%--    <link href="/css/select.css" rel="stylesheet" type="text/css" />--%>
    <script src="/js/jquery.js" type="text/javascript"></script>
<%--    <script src="/js/jquery.idTabs.min.js" type="text/javascript"></script>--%>
<%--    <script src="/js/select-ui.min.js" type="text/javascript"></script>--%>
<%--    <script src="/editor/kindeditor.js" type="text/javascript"></script>--%>
<%--    <script type="text/javascript">--%>
<%--        $(document).ready(function (e){--%>
<%--            $(".select1").uedSelect({--%>
<%--                width : 345--%>
<%--            });--%>
<%--        });--%>
    </script>
</head>

<body>


<div class="formbody">

    <div class="formtitle"><span>书籍信息</span></div>
    <form action="/bookServlet" method="post" id="From">
        <ul class="forminfo">
            <c:if test="${empty book}">
                <input type="hidden" name="type" value="save">
            </c:if>
            <c:if test="${not empty book}">
                <input type="hidden" name="type" value="update">
                <input type="hidden" name="id" value="${book.id}">
            </c:if>
            <li>
                <label>书名</label>
                <input name="bookName" type="text" class="dfinput" value="${requestScope.book.bookName}"/>
                <i>标题不能超过30个字符</i>
            </li>
            <li>
                <label>作者</label>
                <input name="author" type="text" class="dfinput" value="${requestScope.book.author}" />
                <i>多个关键字用,隔开</i>
            </li>
            <li>
                <label>出版社</label>
                <input name="publish" type="text" class="dfinput" value="${requestScope.book.publish}" />
                <i>多个关键字用,隔开</i>
            </li>
            <li>
                <label>书籍编码</label>
                <input name="isbn" type="text" class="dfinput" value="${requestScope.book.isbn}" />
                <i>多个关键字用,隔开</i>
            </li>
            <li><label>书籍语言</label>
                <select name="language" class="dfinput" >
                    <option selected>汉语</option>
                    <option ${requestScope.book.language == '英语 ' ? 'selected' : ''}>英语</option>
                    <option ${requestScope.book.language == '日语' ? 'selected' : ''}>日语</option>
                    <option ${requestScope.book.language == '韩语' ? 'selected' : ''}>韩语</option>
                </select>
            </li>
            <li>
                <label>价格</label>
                <input name="price" type="text" class="dfinput" value="${requestScope.book.price}" />
                <i>多个关键字用,隔开</i>
            </li>
            <li>
                <label>发布日期</label>
                <input name="pubdate" type="date" class="dfinput" value="${requestScope.book.pubdate}" />
                <i>请输入年份</i>
            </li>
            <li>
                <label>书架号</label>
                <input name="pressmark" type="text" class="dfinput" value="${requestScope.book.pressmark}" />
                <i>多个关键字用,隔开</i>
            </li>

            <li><label>书籍介绍</label>
                <textarea name="introduction" cols="" rows="" class="textinput" value="${requestScope.book.introduction}" ></textarea>
            </li>

            <li>
                <label>&nbsp;</label>
                <input name="" type="submit" id="btn" class="btn" value="确认保存"/>
            </li>
        </ul>
    </form>

</div>
<%--  换表单提交方式为jquery  --%>
<script type="application/javascript">
    var flag = true;
    $(function (){
        // blur：当元素失去焦点时触发 blur 事件
        $("#bookName").blur(function () {

        });
        $("#btn").click(function (){
            $("#From").submit();
        })
    })
</script>


</body>
</html>